<?php
require_once dirname(__FILE__) . '/../Config.php';
$dbConfig = array(
	/**
	 *默认数据库配置
	 *db_query与Model的默认配置
	 */
	'default' => array(
		'engine' 	=> 'mysql',
		'host' 		=> '127.0.0.1',
		'port' 		=> '3306',
		'db' 		=> 'sdo_op_pay',
		'user' 		=> 'root',
		'pass' 		=> 'sdooadb',
		'coding' 	=> 'UTF8',
	),
);
function getPayDbConfig ($dbConfig)
{
    $tmp = array();
    for ($i = 0; $i < 256; $i ++) {
        $key = 'sdo_op_pay_db_' . sprintf('%03s', $i);
        $tmp[$key] = $dbConfig['default'];
        $dbName = 'sdo_op_pay_' . sprintf('%03s', $i);
        $tmp[$key]['host'] = $GLOBALS['gConfig']['db_physical'][0]['write']['host'];
        $tmp[$key]['port'] = $GLOBALS['gConfig']['db_physical'][0]['write']['port'];
        $tmp[$key]['user'] = $GLOBALS['gConfig']['db_physical']['db_user'];
        $tmp[$key]['pass'] = $GLOBALS['gConfig']['db_physical']['db_pwd'];
        $tmp[$key]['db'] = $dbName;
    }
    return $tmp;
}
$payDbConfig = getPayDbConfig($dbConfig);
$dbConfig = array_merge($dbConfig, $payDbConfig);
return $dbConfig;